package com.kurumi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kurumi.mapper.MedicalHomepageMapper;
import com.kurumi.mapper.MedicalRecordMapper;
import com.kurumi.pojo.MedicalHomepage;
import com.kurumi.service.SyncDataService;

@Service
public class SyndDataServiceImpl implements SyncDataService{

	@Autowired
	private MedicalRecordMapper medicalRecordMapper;
	
	@Autowired
	private MedicalHomepageMapper medicalHomepageMapper;
	

	@Override
	public List<String> getGuid() {
		// TODO Auto-generated method stub
		return medicalRecordMapper.getMedicalRecordJsonByPage("2020-01-01 00:00:00", "2020-12-31 23:59:59",0,200000);
	}
	
	@Override
	public String getJsonByGuid(String guid){
		return medicalRecordMapper.getMedicalRecordJsonByGuid(guid);
	}

	@Override
	public void insertJson(String json) {
		medicalRecordMapper.insertMedicalRecordJson(json);
	}

	@Transactional
	@Override
	public int insrtMedicalHomepage(MedicalHomepage medicalHomepage) {
		return medicalHomepageMapper.insertSelective(medicalHomepage);
	}
	
	
	public List<String> getRepeatDataJson(){
		return	medicalHomepageMapper.getRepeatJson();
	}

	@Override
	public void deleteRepeatJsonByGuid(String guid) {
		medicalHomepageMapper.deleteRepeatByGuid(guid);		
	}
	
	
	
}
